"""
tournament.py

Author: Trevor Andersen
Created: 17 Sep 2010

Contains the model for a Scrabble tournament.

Classes:
 GameResult
 Section
 Tournament
"""

class GameResult:

    def __init__(self, player1=None, player2=None):
        self.setPlayers(player1, player2)
        self.setScore(None, None)
        self.setAsWalkover(False)
        self.setAsBye(False)
        self.setBonuses(None, None)
        self.setGameAnnotation(None)
        self.extra = {}

    def setPlayers(self, player1, player2):
        self.player1 = player1
        self.player2 = player2        

    def setScore(self, score1, score2):
        self.score1 = score1
        self.score2 = score2

    def setAsWalkover(self, boolean):
        self.walkover = boolean

    def setAsBye(self, boolean):
        self.bye = boolean

    def setBonuses(self, bonuses1, bonuses2):
        self.bonuses1 = bonuses1
        self.bonuses2 = bonuses2

    def setGameAnnotation(self, annotation):
        self.annotation = annotation

    def setExtraInfo(self, key, value):
        self.extra[key] = value

class Section:

    def __init__(self):
        self.players = []
        self.rounds = []
        self.teams = {}

    def addGameResult(self, rnd, result):
        while rnd < len(self.rounds):
            self.rounds.append([])
        
            

    def addPlayer(self, name, team=None):
        self.players.append(player)

    def removePlayer(self, name):
        pass

    def assignPlayerToTeam(self, name, newTeam=None):
        pass

    def removePlayerFromTeam(self, name):
        pass

    def getNumberOfPlayers(self):
        pass

    def getNumberOfRounds(self):
        pass

    def getPlayerByNumber(self, number):
        pass

    def
        
